// 判断用户滑动的是向左滑动还是向右滑动
export default function getTouchDirection({ startX, startY }, endX, endY) {
  let direction = ""; // 存储滑动方向
  
  if (endX - startX > 30 && Math.abs(endY - startY) < 30) {
    // 右滑
    direction = "right";
  } else if (endX - startX < -30 && Math.abs(endY - startY) < 30) {
    // 左滑
    direction = "left";
  }

  return direction;
}
